<template>
<!-- <button @click="$emit('getData',count)">子传父</button> -->
 
 <h3>子组件</h3>
 <slot></slot>
 <slot name="footer"></slot>
     <div class="myDiv" v-if="$slots.header">
        <slot name="header" :yourName="yourName"></slot>
     </div>
</template>

<script setup>
import { ref } from 'vue';

const count = ref(0);
const yourName =ref('李四');
</script>

<style scoped>
.myDiv{
    width: 200px;
    height: 200px;
    background-color: darkturquoise;
}
</style>